const express = require('express')
const router = express.Router()
const routerHandler = require('../router_handler/userinfo')

//自动验证中间件
const expressJoi = require('@escook/express-joi')
// 导入验证规则
const {info_updata_schema,pwd_updata_schema,avatar_updata_schema} = require('../schema/user')

router.get('/userinfo', routerHandler.getInfo)
router.post('/userinfo', expressJoi(info_updata_schema),routerHandler.updateInfo)
router.post('/updatepwd', expressJoi(pwd_updata_schema), routerHandler.updatePwd)
router.post('/update/avatar', routerHandler.updateAvatar)

module.exports = router
